<template>
    <ElSelect filterable clearable :="$attrs">
        <ElOption v-for="item in options" :key="item.userId" :label="item.flowerName" :value="item.userId" />
    </ElSelect>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { ElSelect, ElOption } from 'element-plus'
import { getUserListByRoleId } from '../api'

interface Props {
    data: any;
}
const props = withDefaults(defineProps<Props>(), {
    data: () => ({}),
})

const options = ref<Array<{ flowerName: string, userId: string }>>([])

const getOptions = () => {
    getUserListByRoleId({ roleId: 38 })
        .then(res => {
            options.value = res
        })
}

onMounted(() => {
    getOptions()
})
</script>